/**
 *
 */
package com.ybkj.daijia.server.service.impl;

import com.ybkj.daijia.page.Page;
import com.ybkj.daijia.server.mapper.CarTypeMapper;
import com.ybkj.daijia.server.model.CarType;
import com.ybkj.daijia.server.service.CarTypeService;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author Shine
 */
@Service
public class DefaultCarTypeService implements CarTypeService {

    @Autowired
    private CarTypeMapper carTypeMapper;

    @Override
    public int save(CarType carType) {
        int i = carTypeMapper.insertCarType(carType);
        return i;
    }

    @Override
    public int delete(Long id) {
        int i = carTypeMapper.deleteById(id);
        return i;
    }

    @Override
    public int update(CarType carType) {
        int i = carTypeMapper.updateById(carType);
        return i;
    }

    @Override
    public CarType findById(Long id) {
        CarType carType = carTypeMapper.selectById(id);

        return carType;
    }

    @Override
    public List<CarType> findAll() {
        List<CarType> list = carTypeMapper.selectAll();
        return list;
    }

    @Override
    public List<CarType> selectByCompany(Long companyId, Integer offset,
        Integer size) {
        return null;
    }

    @Override
    public Page<Map<String, Object>> queryByCompany(Long companyId,
        Integer page, Integer limit) {
        return null;
    }

    @Override
    public CarType findByName(String name) {
        CarType carType = carTypeMapper.selectByName(name);

        return carType;

    }

    @Override
    public List<CarType> findBycarTypeIn(String[] carTypes) {

        List<CarType> list = carTypeMapper.selectBycarType(carTypes);

        return list;
    }

}